
import axios from 'axios';

/**
 * 付款记录
 */
export class PaymentRecordService {
    // 分页查询列表
    static findPaymentRecords (queryParams) {
        return axios({
            url: '/restaurant/sale/PaymentRecord/findPaymentRecords',
            method: 'POST',
            data: queryParams
        });
    }

    //根据ID查询指定的付款记录
    static findPaymentRecord (paymentRecordId) {
        const query = {
            paymentRecordId
        }
        return axios({
            url: '/restaurant/sale/PaymentRecord/findPaymentRecord',
            method: 'POST',
            params: query,
        });
    }

    //根据ID查询指定的付款记录(包含外键名称)
    static findPaymentRecordForView (paymentRecordId) {
        const query = {
            paymentRecordId
        }
        return axios({
            url: '/restaurant/sale/PaymentRecord/findPaymentRecordForView',
            method: 'POST',
            params: query,
        });
    }

    //根据ID查询指定的付款记录(包含外键名称)
    static findPaymentRecordForEdit (paymentRecordId) {
        const query = {
            paymentRecordId
        }
        return axios({
            url: '/restaurant/sale/PaymentRecord/findPaymentRecordForEdit',
            method: 'POST',
            params: query,
        });
    }

    //根据ID查询指定的付款记录(只提取ID 和 Name)
    static findPaymentRecordsWithIdNameById (paymentRecordId) {
        const query = {
            paymentRecordId
        }
        return axios({
            url: '/restaurant/sale/PaymentRecord/findPaymentRecordsWithIdNameById',
            method: 'POST',
            params: query,
        });
    }

    //根据名称查询付款记录集合(只提取ID 和 Name)
    static findPaymentRecordsWithIdNameByName (paymentRecordName) {
        const query = {
            paymentRecordName
        }
        return axios({
            url: '/restaurant/sale/PaymentRecord/findPaymentRecordsWithIdNameByName',
            method: 'POST',
            params: query,
        });
    }

    //新增保存付款记录
    static savePaymentRecord (paymentRecord) {
        const query = {}
        return axios({
            url: '/restaurant/sale/PaymentRecord/savePaymentRecord',
            method: 'POST',
            params: query,
            data: paymentRecord
        });
    }

    //修改保存付款记录
    static updatePaymentRecord (paymentRecord) {
        const query = {}
        return axios({
            url: '/restaurant/sale/PaymentRecord/updatePaymentRecord',
            method: 'POST',
            params: query,
            data: paymentRecord
        });
    }

    //根据ID查询指定的付款记录(只提取ID 和 Name)
    static deletePaymentRecord (paymentRecordId) {
        const query = {
            paymentRecordId
        }
        return axios({
            url: '/restaurant/sale/PaymentRecord/deletePaymentRecord',
            method: 'POST',
            params: query,
        });
    }
}
